package com.pgytesting.threenewboard.service;

import java.util.LinkedHashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * @version v1.0
 * @ProjectName: ResponseMessage
 * @ClassName: ResponseMessage
 * @Description: TODO(一句话描述该类的功能)
 * @Author: sunbo@pgytesting.cn
 * @Date: 2019/1/4 17:50
 */
public class ResponseMessage {


    private static final Logger logger = LoggerFactory.getLogger(ResponseMessage.class);


    /**
     * @param @param  paraMap
     * @param @return 设定文件
     * @return Map<String   ,   Object>    返回类型
     * @throws
     * @Title: isSuccess
     * @Description: TODO(成功)
     */
    public static Map<String, Object> isSuccess(Object paraMap) {
        LinkedHashMap<String, Object> linkMap = new LinkedHashMap<>();
        linkMap.put("statusCode", "2000");
        linkMap.put("message", "SUCCESS");
        linkMap.put("data", paraMap);
        logger.info("请求成功，调用有参方法，返回成功参数！");
        return linkMap;
    }

    /**
     * @param @return 设定文件
     * @return Map<String   ,   Object>    返回类型
     * @throws
     * @Title: isSuccess
     * @Description: TODO(成功)
     */
    public static Map<String, Object> isSuccess() {
        LinkedHashMap<String, Object> linkMap = new LinkedHashMap<>();
        linkMap.put("statusCode", "2000");
        linkMap.put("message", "SUCCESS");
        logger.info("请求成功，调用无参方法，返回成功参数！");
        return linkMap;
    }

    /**
     * @param @param  paraMap
     * @param @return 设定文件
     * @return Map<String   ,   Object>    返回类型
     * @throws
     * @Title: isError
     * @Description: TODO(错误)
     */
    public static Map<String, Object> isError(Object paraMap) {
        LinkedHashMap<String, Object> linkMap = new LinkedHashMap<>();
        linkMap.put("statusCode", "3000");
        linkMap.put("message", "ERROR");
        linkMap.put("data", paraMap);
        logger.info("请求错误，调用有参方法，返回成功参数！");
        return linkMap;
    }

    /**
     * @param @return 设定文件
     * @return Map<String   ,   Object>    返回类型
     * @throws
     * @Title: isError
     * @Description: TODO(错误)
     */
    public static Map<String, Object> isError() {
        LinkedHashMap<String, Object> linkMap = new LinkedHashMap<>();
        linkMap.put("statusCode", "3000");
        linkMap.put("message", "ERROR");
        logger.info("请求错误，调用无参方法，返回成功参数！");
        return linkMap;
    }
}
